package Object.StudentManager;

public class Test {
    public static void main(String[] args) {
    Girl me = new Girl();
    me.setName("肖晶晶");
    me.setage(120);
    }
}
//合理隐藏，合理暴露
class Girl{
    private String name;
    private int age;
    public String getName(){
        return this.name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public int getage(){
        return this.age;
    }
    public void setage(int age){
        if(age>100){
            System.out.println("数字太大了吧！");;
        }
        this.age = age;
    }
}
